#include "switch.h"
#include "gpio.h"
#include "main.h"

uint8_t switch_read(uint8_t which)
{
    switch (which) {
        case 1: return !(HAL_GPIO_ReadPin(S1_GPIO_Port, S1_Pin)); break;
        case 2: return !(HAL_GPIO_ReadPin(S2_GPIO_Port, S2_Pin)); break;
        case 3: return !(HAL_GPIO_ReadPin(S3_GPIO_Port, S3_Pin)); break;
        case 4: return !(HAL_GPIO_ReadPin(S4_GPIO_Port, S4_Pin)); break;
        default: return 0; break;
    }
}